var ktree = "#ktree", kcenter = "#kcenter", ktaskData = "#ktaskData";
var repoTypeData = [], dbTypeData = [], dbAccessData = [], paramTypeData = [];
var menuData = [{
	text: '资源库管理',
	route: pageRoute.repoList
},{
	text: '数据整合',
	route: pageRoute.dataInteList
},{
	text: '任务管理',
	route: pageRoute.taskList
},{
	text: '系统管理',
	children: [{
		text: '全局参数',
		route: pageRoute.paramList
	},{
		text: '帮助',
		route: pageRoute.help
	}]
}];

$(function() {
	$(ktree).tree({
		lines: true,
		data: menuData,
		onClick: function(node) {
			if ($(ktree).tree('isLeaf', node.target)) {
				$(kcenter).panel({ href: node.route });
			}
		}
	});
	
	$.get(reqRoute.repositoryType, {}, function(resultData) {
		if (resultData.status == successCode && null != resultData.data) {
			repoTypeData = resultData.data;
		}
	});
	$.get(reqRoute.databaseType, {}, function(resultData) {
		if (resultData.status == successCode && null != resultData.data) {
			dbTypeData = resultData.data;
		}
	});
	$.get(reqRoute.databaseAccessType, {}, function(resultData) {
		if (resultData.status == successCode && null != resultData.data) {
			dbAccessData = resultData.data;
		}
	});
	$.get(reqRoute.gparamType, {}, function(resultData) {
		if (resultData.status == successCode && null != resultData.data) {
			paramTypeData = resultData.data;
		}
	});
});